<template>
	<view class="center">
		<u-navbar title="确认订单"></u-navbar>
		<view class="content">
			<!-- 地址信息 -->
			<view class="address"  @click="onaddress">
				<view class="address-item" >
					<image :src="imgBaseUrl+'/ache/images/position.png'" class="img"></image>
					<view class="address-city">
						<view class="address-title" v-if="showaddress">
							<view class="address-info">
								请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址请选择收货地址
							</view>
							<view class="user">张小斐 15098809323</view>
						</view>
						<view class="address-title" v-else ><view class="address-info">请选择收货地址</view></view>
					</view>
				</view>
				<view class="right-item">></view>
			</view>
			<!-- 商品信息 -->
			<view class="goods-center">
				<view class="goods-title">商品信息</view>
				<!-- 订单item -->
				<view class="goods-item">
					<view class="goods-info">
						<image class="img"  :src="imgBaseUrl+'/ache/images/logoicon.png'"></image>
						<view class="goods-details">
							<view class="goods-title">悄红颜紧致提拉精华液</view>
							<view class="goods-Spec">150g/瓶</view>
							<view class="goods-Price">
								<view class="Price">￥29.90</view>
								<view class="quantity">X 2</view>
							</view>
						</view>
					</view>
				</view>
				<view class="allgoods">
					<view class="title">商品金额</view>
					<view class="price">￥74.80</view>
				</view>
				<view class="allgoods">
					<view class="title">运费</view>
					<view class="price">￥0</view>
				</view>
			</view>
			<!-- 备注信息 -->

			<view class="goods-bottom">
				<view class="title">订单备注</view>
				<u-input v-model="value" :type="type" :height="height" :auto-height="autoHeight" :placeholder="valuetext" maxlength="50" />
			</view>

			<view class="bottom-button">
				<view class="button-left">
					合计：
					<view class="price">￥74.80</view>
				</view>
				<button class="button-right" @click="onpayment">确认提交</button>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapGetters } from 'vuex';
export default {
	computed: {
		...mapGetters(['imgBaseUrl'])
	},
	components: {},
	data() {
		return {
			showaddress: false,
			value: '',
			type: 'textarea',
			height: 100,
			autoHeight: true,
			valuetext: '请输入订单备注（最多50字）'
		};
	},
	created() {},

	methods: {
		//跳转修改地址
		onaddress(){
			uni.navigateTo({
				url:'/pages/address/index',
			})
			console.log('点击修改地址了')
		},
		//跳转去支付
		onpayment(){
			uni.switchTab({
				url:'/pages/cart/index',
			})
			
			console.log('点击了提交啊')
		}
	}
};
</script>

<style lang="scss">
@import '@/styles/mixin.scss';
.center {
	width: 100%;
	min-height: 100%;
	background-color: #f5f5f5;
	.content {
		.address {
			border-radius: 20rpx;
			padding: 40rpx;
			border-radius: 20rpx;
			margin-top: 22rpx;
			width: 100%;
			background-color: #ffffff;
			display: flex;
			flex-direction: row;
			flex-wrap: nowrap;
			justify-content: space-between;
			align-items: baseline;
			.address-item {
				display: flex;
				.img {
					width: 51rpx;
					height: 51rpx;
				}
				.address-city {
					width: 100%;
					.address-title {
						padding-left: 20rpx;
						.address-info {
							text-overflow: -o-ellipsis-lastline;
							overflow: hidden;
							text-overflow: ellipsis;
							display: -webkit-box;
							-webkit-line-clamp: 2;
							line-clamp: 2;
							-webkit-box-orient: vertical;
							font-size: 26rpx;
							font-weight: bold;
							color: #222222;
						}
						.user {
							padding-top: 10rpx;
							font-size: 26rpx;
							color: #888888;
							font-weight: 400;
						}
					}
				}
			}
			.right-item {
				font-size: 26rpx;
				color: #888888;
			}
		}
		.goods-center {
			padding: 20rpx;
			margin-top: 20rpx;
			width: 100%;
			background-color: #ffffff;
			border-radius: 20rpx;
			.goods-title {
				font-size: 26rpx;
				font-weight: bold;
				color: #222222;
			}
			.allgoods {
				padding: 20rpx;
				display: flex;
				flex-direction: row;
				flex-wrap: nowrap;
				align-items: baseline;
				justify-content: space-between;
				.title {
					font-weight: 400;
					font-size: 26rpx;
					color: #222222;
				}
				.price {
					font-size: 28rpx;
					font-weight: bold;
					color: #222222;
				}
			}
			.goods-item {
				padding-top: 20rpx;
				// border-bottom: 1rpx solid  #888888;
				overflow: hidden;
				.goods-info {
					display: flex;
					flex-direction: row;
					flex-wrap: nowrap;
					.img {
						display: flex;
						height: 175rpx;
						width: 150rpx;
					}
					.goods-details {
						width: 676rpx;
						.goods-title {
							text-overflow: -o-ellipsis-lastline;
							overflow: hidden;
							text-overflow: ellipsis;
							display: -webkit-box;
							-webkit-line-clamp: 2;
							line-clamp: 2;
							-webkit-box-orient: vertical;
							padding: 10rpx;
							font-size: 26rpx;
							font-weight: 400;
							color: #222222;
						}
						.goods-Spec {
							padding: 10rpx;
							display: inline-block;
							font-size: 20rpx;
							color: #888888;
							background-color: #f6f6f6;
							border-radius: 5rpx;
						}
						.goods-Price {
							padding: 10rpx;
							width: 100%;
							display: flex;
							flex-direction: row;
							flex-wrap: nowrap;
							justify-content: space-between;
						}
						.Price {
							color: #f53942;
							font-size: 30rpx;
							font-weight: bold;
						}
						.quantity {
							font-size: 26rpx;
							font-weight: 500;
							color: #888888;
							padding-right: 24rpx;
						}
					}
				}
			}
		}
		.goods-bottom {
			margin-top: 20rpx;
			padding: 20rpx;
			border-radius: 20rpx;
			background: #ffffff;
			.title {
				padding: 20rpx;
				font-size: 26rpx;
				font-weight: 400;
				color: #222222;
			}
		}
		.bottom-button {
			padding: 20rpx;
			display: flex;
			flex-direction: row;

			flex-wrap: nowrap;
			align-items: baseline;
			background-color: #ffffff;
			width: 100%;
			position: fixed;
			bottom: 0;
			justify-content: flex-end;
			.button-left {
				align-items: baseline;
				display: flex;
				font-size: 28rpx;
				font-weight: 400;
				color: #333333;
				.price {
					padding-right: 20rpx;
					font-size: 42rpx;
					font-weight: bold;
					color: #f53942;
				}
			}
			.button-right {
				color: #ffffff;
				border-radius: 39rpx;
				width: 270rpx;
				height: 78rpx;
				background: #f53942;
			}
		}
	}
}
</style>
